#pragma once
#include "dameon.h"

extern FILE             *file_open_log;

#define log(format, args...);   \
    fprintf(stdout, "Notice: " format "\n", ##args);

#define log2(format, args...);   \
    fprintf(stdout, "%s %d %s | " format, __FILE__, __LINE__, __func__, ##args); 

#define llog(format, args...);   \
    fprintf(stdout, "from file %s line %d function name %s |" format "\n", __FILE__, __LINE__, __func__, ##args);  
    
//#define llog(format, args...);   \
//    fprintf(file_open_log, "from file %s line %d function name %s |" format "\n", __FILE__, __LINE__, __func__, ##args);
 
/*  
#define log_notice(format, args...);   \
    fprintf(file_open_log, "NOTICE: from file %s line %d function name %s |" format "\n", __FILE__, __LINE__, __func__, ##args);
    
#define log_error(format, args...);   \
    fprintf(file_open_log, "ERROR: from file %s line %d function name %s |" format "\n", __FILE__, __LINE__, __func__, ##args);
*/
    
int ReadFile(std::string &s, const char* filename);
int WriteLog(const char *buf, const char *filename, const char *method);
int WriteLog(const char *buf, const char *filename, const char *method, bool show_time);
int WriteLogT(const char *buf);
int WriteLogE(const char *buf);
int WriteLog(const char *buf);
int WriteLogTime(const char *buf);
int WriteLogLoc(const char *buf, const char *filename, int line, const char *func);

void notice_msg(const char* msg);
void ok_msg(const char* msg);
